/*
Copyright (c) 2025 HeZongLun
NahidaProject is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan
PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/

#include "CowSay.h"

std::string NahidaProject::CowSay::UnderscoreLength(std::string var){
	std::string start = " _";
	std::string add = "_";
	for (int i = 0; i <= var.size(); i++){
		start = start + add;
	}
	return start;
}

std::string NahidaProject::CowSay::HyphenLength(std::string var){
	std::string start("  -");
	std::string add("-");
	for (int i = 0; i <= var.size(); i++){
		start = start + add;
	}
	return start;
}

std::string NahidaProject::CowSay::Cow(std::string text){
	char star = '*';
	std::stringstream resultStream;
	resultStream << " " << UnderscoreLength(text) << "\n";
	resultStream << " < " << text << " >" << "\n";
	resultStream << HyphenLength(text) << "\n";
    resultStream << "  " << "\n"
		"         \\   ^__^\n"
		"          \\  (oo)\\_______\n"
		"             (__)\\       )\\/\\\n"
		"               ||----w |\n"
		"               ||     ||\n" << "\n";

	return resultStream.str();
}
